# Contributor: Maxim Karasev <begs@disroot.org>
# Maintainer: Maxim Karasev <begs@disroot.org>
pkgname=waifu2x-converter-cpp
pkgver=5.3.4
pkgrel=5
pkgdesc="image upscaler for anime-style art capable of opencl"
url="https://github.com/DeadSix27/waifu2x-converter-cpp"
arch="all !ppc64le !s390x !riscv64" # limited by opencv
license="MIT"
depends="so:libOpenCL.so.1"
makedepends="cmake opencl-dev opencv-dev samurai"
source="https://github.com/DeadSix27/waifu2x-converter-cpp/archive/v$pkgver/waifu2x-converter-cpp-$pkgver.tar.gz"
options="!check" # no tests

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B build \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-G Ninja \
		$CMAKE_CROSSOPTS .
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
05bd5114bd5bf5084d619d6509e51bdc642d5643775d91f03ca0995cbc5e32e757f00f6f31706533546b5d936638c0dd9d2da8ccca25b3498ff4da4020695c2a  waifu2x-converter-cpp-5.3.4.tar.gz
"
